package com.example.javaee.service;

import com.example.javaee.domain.Comment;
import com.example.javaee.exception.CourseAdminException;

import java.io.IOException;
import java.util.List;
/**
 * @Description: 评论业务层接口
 */
public interface CommentService {
    //查询评论列表
    List<Comment> listComment() throws CourseAdminException;
    //保存评论
    Comment saveComment(Comment comment) throws CourseAdminException;

    List<Comment> findByUserId(Integer userId) throws CourseAdminException;


    List<Comment> findBycourseNumber(Long courseNumber) throws CourseAdminException, IOException;

    void addLikeCount(Integer userId, Long commentId) throws CourseAdminException;
    void addDislikeCount(Integer userId, Long commentId) throws CourseAdminException;

    void undoLike(Integer userId, Long commentId) throws CourseAdminException;

    void undoDislike(Integer userId, Long commentId) throws CourseAdminException;

    void deleteComment(Long id); // throws CourseAdminException;

    List<Comment> adminFindByCourseNumber(Long courseNumber);
}
